//
//  PoliteVcCell.m
//  Wy_FlowerDelivery
//
//  Created by wangyang on 2020/2/1.
//  Copyright © 2020 wangyang. All rights reserved.
//

#import "PoliteVcCell.h"

@implementation PoliteVcCell

-(UIImageView *)WyBackImg

{
    if (!_WyBackImg) {
        
        _WyBackImg = [UIImageView imageWithImgName:@"优惠券备份 3" superView:self.contentView];
        [_WyBackImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.equalTo(CGSizeMake(WySCREENWIDTH-30, BiLiWidth(100)));
            make.top.mas_offset(BiLiWidth(20));
            make.centerX.mas_offset(0);
        }];
        _WyBackImg.userInteractionEnabled = YES;
        
    }
    
    return _WyBackImg;
}

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier

{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self.contentView addSubview:self.WyBackImg];
        
            _moneyLab = [UILabel labelWithContent:@"¥20" superView:self.WyBackImg textColor:WyBlackColor font:[UIFont systemFontOfSize:22] textAlignment:NSTextAlignmentLeft];
               [_moneyLab mas_makeConstraints:^(MASConstraintMaker *make) {
                   make.size.equalTo(CGSizeMake(BiLiWidth(80), BiLiWidth(31)));
                   make.left.mas_offset(BiLiWidth(24));
                   make.top.mas_offset(BiLiWidth(25));
               }];
               
               _userLab = [UILabel labelWithContent:@"满200元可用" superView:self.WyBackImg textColor:UIColorFromRGB(0xFF663C) font:[UIFont systemFontOfSize:10] textAlignment:NSTextAlignmentLeft];
               [_userLab mas_makeConstraints:^(MASConstraintMaker *make) {
                   make.size.equalTo(CGSizeMake(BiLiWidth(68), BiLiWidth(11.5)));
                   make.left.mas_offset(BiLiWidth(27.5));
                   make.top.equalTo(self.moneyLab.bottom).offset(BiLiWidth(10));
               }];
               
               _nameLab = [UILabel labelWithContent:@"全场无门槛优惠券" superView:self.WyBackImg textColor:[UIColor blackColor] font:[UIFont systemFontOfSize:16] textAlignment:NSTextAlignmentLeft];
               [_nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
                   make.size.equalTo(CGSizeMake(BiLiWidth(128), BiLiWidth(16)));
                   make.left.equalTo(self.userLab.right).offset(BiLiWidth(15));
                   make.top.mas_offset(BiLiWidth(26));
               }];
               
               
               _timeLab = [UILabel labelWithContent:@"有效期至2020-12-31" superView:self.WyBackImg textColor:UIColorFromRGB(0x999999) font:[UIFont systemFontOfSize:12] textAlignment:NSTextAlignmentLeft];
               [_timeLab mas_makeConstraints:^(MASConstraintMaker *make) {
                   make.size.equalTo(CGSizeMake(BiLiWidth(180), BiLiWidth(12)));
                   make.left.equalTo(self.userLab.right).offset(BiLiWidth(15));
                   make.top.equalTo(self.nameLab.bottom).offset(BiLiWidth(20));
               }];
               
               
              
        
    }
    
    return self;
    
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
